home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C26 / MemCheck.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  615 b   |  21 lines

  1. //: C26:MemCheck.h
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Memory testing system
  7. // This file is only included if you want to
  8. // use the special placement syntax to find
  9. // out the line number where "new" was called.
  10. #ifndef MEMCHECK_H
  11. #define MEMCHECK_H
  12. #include <cstdlib>  // size_t
  13.  
  14. // Use placement syntax to pass extra arguments.
  15. // From an idea by Reg Charney:
  16. void* operator new(
  17.   std::size_t sz, char* file, int line);
  18. #define new new(__FILE__, __LINE__)
  19.  
  20. #endif // MEMCHECK_H ///:~
  21.